<?php
session_start();
require_once 'classes/Membership.php';
$membership = new Membership();

// If the user clicks the "Log Out" link on the index page.
if(isset($_GET['status']) && $_GET['status'] == 'loggedout') {
	$membership->log_User_Out();
}

// Did the user enter a password/email and click submit?
if($_POST && !empty($_POST['email']) && !empty($_POST['pwd'])) {
	$response = $membership->validate_User($_POST['email'], $_POST['pwd']);
}
														

?>


<?php include('../includes/header.php'); ?>
<title>Login - Lorerider</title>


<?php include('../includes/resources.php'); ?>
<?php include('../includes/links.php'); ?>
<style>
.form-signin {
        max-width: 300px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
        margin-bottom: 15px;
        padding: 7px 9px;
      }

</style>
<?php $_SESSION["login"] = "current"; unset($_SESSION["signup"]); unset($_SESSION["home"]); include('../includes/body.php'); ?>
<div id="login">
	<form method="post" action="" class="form-signin">
    	<h2>Login <small>enter your credentials</small></h2>
        <p>
            <input type="text" placeholder="Email" name="email" />
        </p>
        
        <p>
            <input type="password" placeholder="Password" name="pwd" />
        </p>
        <label class="checkbox">
          <input type="checkbox" name="remember" value="remember-me"> Remember me
        </label>
        <button class="btn btn-large btn-primary" type="submit">Login</button>
    </form>
    <?php if(isset($response)) echo "<h4 class='alert'>" . $response . "</h4>"; ?>
</div><!--end login-->
<?php include('../includes/footer.php'); ?>